home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 523 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.7 KB

  1. Path: chronicle.mti.sgi.com!austern
  2. From: cbarber@bbn.com (Christopher Barber)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: standardizing routines without main()
  5. Date: 15 Feb 1996 13:32:15 PST
  6. Organization: BBN
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <CBARBER.96Feb15151343@figaro.bbn.com>
  9. References: <4fvmd1$bh1@syn.cs.cornell.edu>
  10. NNTP-Posting-Host: isolde.mti.sgi.com
  11. X-Original-Date: 15 Feb 1996 20:13:43 GMT
  12. In-Reply-To: vavasis@CS.Cornell.EDU's message of 15 Feb 1996 09:20:36 PST
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBVAwUBMSOmdEy4NqrwXLNJAQFHSAH/dRjbQlSEkxWzcBai2cqF9oT1NmqNJM21
  15.     AMucZEoJ/FPkIJ2e+voKaQQa3xdwpPv4zZrmyqVNEVddQWa9xm+P9g==
  16.     =Lpai
  17. Originator: austern@isolde.mti.sgi.com
  18.  
  19. >>>>> "SV" == Stephen Vavasis <vavasis@CS.Cornell.EDU> writes:
  20.  
  21.     SV> I would like to write a subroutine in C++ that gets called
  22.     SV> by an existing program.  The subroutine might get loaded with a
  23.     SV> dynamic loader into an already compiled program to which I, the C++
  24.     SV> programmer, have no access. 
  25.  
  26.     SV> In this case, there is no C++ main().  Nonetheless, I would still
  27.     SV> like to use C++ features like global static data items whose
  28.     SV> constructors and destructors get called.
  29.  
  30. You can still use global static data.  The constructors will be called
  31. the first time the shared object is loaded.  Of course, you need to have
  32. a compiler that will support building shared objects.
  33.  
  34. - Chris
  35.  
  36.  
  37. -- 
  38. Christopher Barber ----- Software Engineer ---- BBN Systems and Technologies
  39. ---
  40. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  41.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  42.   in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
  43.